﻿using System;
using UnityEngine;
namespace HBFramework
{
    /// <summary>
    /// 碰撞器观察
    /// </summary>
    [DisallowMultipleComponent]
    public class ColliderObserver : MonoBehaviour
    {
        public Action<Collision> OnCollisionEnterAct;
        public Action<Collision> OnCollisionStayAct;
        public Action<Collision> OnCollisionExitAct;
        private void OnCollisionEnter(Collision collision)
        {
            OnCollisionEnterAct?.Invoke(collision);
        }

        private void OnCollisionStay(Collision collision)
        {
            OnCollisionStayAct?.Invoke(collision);
        }

        private void OnCollisionExit(Collision collision)
        {
            OnCollisionExitAct?.Invoke(collision);
        }
    }
}